package com.example.chessbattleplatform.web.chess_rooms.Pojo.Enum;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.baomidou.mybatisplus.annotation.IEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

@Getter
@AllArgsConstructor

// 房间的类型
public enum RoomTypeEnum implements IEnum<Integer> {
    // 房间的类型

    //  1 公开
    PUBLIC(1, "PUBLIC"),
    //  2 私密
    PRIVATE(2, "PRIVATE");

    @EnumValue // 标记数据库存的值是code
    private final int code;

    private final String roomType;


    @Override
    public Integer getValue() {
        return this.getCode();
    }

    @Override
    public String toString() {
        return  roomType;
    }
}
